#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "InvocationAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Signal;

/// <summary>
/// BroadcastSignalAction
/// A BroadcastSignalAction is an InvocationAction that transmits a Signal instance
/// to all the potential target objects in the system. Values from the argument
/// InputPins are used to provide values for the attributes of the Signal. The
/// requestor continues execution immediately after the Signal instances are sent
/// out and cannot receive reply values.
/// </summary>
class UMLMODEL_EXPORT BroadcastSignalAction : public InvocationAction {

public: // Constructors and destructors
    explicit BroadcastSignalAction(const QString& umlType="uml::BroadcastSignalAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// signal getter
    /// The Signal whose instances are to be sent.
    /// </summary>
    shared_ptr<Signal> signal() const;

    /// <summary>
    /// signal setter
    /// The Signal whose instances are to be sent.
    /// </summary>
    void setSignal(shared_ptr<Signal> value);

private: // Fields
    /// <summary>
    /// signal
    /// The Signal whose instances are to be sent.
    /// </summary>
    shared_ptr<Signal> signal_;

};

} // namespace uml
